<!--

    Copyright 2006-2020 the original author or authors.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<html>
<head>
    <title>About</title>
</head>

<body>

<p>Objenesis is a small Java library that serves one purpose:</p>

<ul>
    <li><strong>To instantiate a new object of a particular class.</strong></li>
</ul>

<h1>When would you want this?</h1>

<p>Java already supports this dynamic instantiation of classes using <code>Class.newInstance()</code>.
    However, this only works if the class has an appropriate constructor. There are many times when a class
    cannot be instantiated this way, such as when the class contains:</p>

<ul>
    <li>Constructors that require arguments.</li>
    <li>Constructors that have side effects.</li>
    <li>Constructors that throw exceptions.</li>
</ul>

<p>As a result, it is common to see restrictions in libraries stating that classes must require a
    default constructor. Objenesis aims to overcome these restrictions by bypassing the constructor on object
    instantiation.</p>

<h1>Typical uses</h1>

<p>Needing to instantiate an object without calling the constructor is a fairly specialized task, however
    there are certain cases when this is useful:</p>
<ul>
    <li><strong>Serialization, Remoting and Persistence</strong>
        - Objects need to be instantiated and restored to a specific state, without invoking code.
    </li>
    <li><strong>Proxies, AOP Libraries and Mock Objects</strong>
        - Classes can be subclassed without needing to worry about the super() constructor.
    </li>
    <li><strong>Container Frameworks</strong>
        - Objects can be dynamically instantiated in non-standard ways.
    </li>
</ul>

<h1>Getting Started</h1>

<ol>
    <li><a href="download.html">Download</a> Objenesis.</li>
    <li>Read the <a href="tutorial.html">twenty second tutorial</a>.</li>
</ol>

<h1>How it Works</h1>

<p>Objenesis uses a variety of approaches to attempt to instantiate the object, depending on the type of object,
JVM version, JVM vendor and SecurityManager present. These are described in full in the
    <a href="details.html">detailed documentation</a>.</p>

<h1>Avoiding the Dependency</h1>

<p>For something as straight forward as instantiating an object, it can be a pain introducing yet another
    library dependency into your project. Objenesis is easy to <a href="embedding.html">embed in your
    existing library</a> so your end users don't even know it's there.</p>


<h1>Supported JVMs</h1>

<p>The list of tested JVMs is available <a href="https://github.com/easymock/objenesis/blob/master/SupportedJVMs.md">here</a>.
Other JVMs might be supported be haven't been tested yet. You can test your environment using the
<a href="details.html#testYourEnvironment">TCK</a> and we would be glad to have <a href="support.html">feedback</a>
on any supported / unsupported JVM.</p>

<h1>Benchmarking</h1>

<p>We do more and more benchmarking to make sure Objenesis has great performance but also to settled the best way to
use it for multiple use-cases. Results are added <a href="https://github.com/easymock/objenesis/blob/master/Benchmarks.md">here</a>. Please, <a href="support.html">share your own results</a>.
Especially, if they differ from ours.</p>

</body>
</html>
